import { lazy } from "react";
import {
  AppOutline,
  AppstoreOutline,
  BellOutline,
  UserOutline,
} from "antd-mobile-icons";

let Loign = lazy(() => import("../pages/login"));
let Mainlayout = lazy(() => import("../pages/mainlayout"));
let Error = lazy(() => import("../pages/404"));

let Home = lazy(() => import("../pages/home"));
let Porps = lazy(() => import("../pages/porps"));
let Message = lazy(() => import("../pages/message"));
let User = lazy(() => import("../pages/user"));

export const homeroute = [
  {
    path: "/",
    element: <Home></Home>,
    title: "首页",
    icon: <AppOutline />,
  },
  {
    path: "/porps",
    element: <Porps></Porps>,
    title: "直达",
    icon: <AppstoreOutline />,
  },
  {
    path: "/message",
    element: <Message></Message>,
    title: "消息",
    icon: <BellOutline />,
  },
  {
    path: "/user",
    element: <User></User>,
    title: "我的",
    icon: <UserOutline />,
  },
];

export const route = [
  {
    path: "/",
    element: <Mainlayout></Mainlayout>,
    children:homeroute
  },
  {
    path: "/login",
    element: <Loign></Loign>,
  },
  {
    path: "*",
    element: <Error></Error>,
  },
];
